﻿using Castle.Components.DictionaryAdapter;
using CommunityToolkit.Mvvm.ComponentModel;
using LongSCADA_WPF.Models;
using LongSCADA_WPF.UseControlS;
using MaterialDesignThemes.Wpf;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;

namespace LongSCADA_WPF.Services
{
	public class UserModelService:ObservableObject
	{
		private UserModel _userModel = new UserModel(){ UserName = "visitor", PassWord = "1111" };

		/// <summary>
		/// 登录用户
		/// </summary>
		public UserModel CurrentUserModel
		{
			get => _userModel;
			set =>SetProperty(ref _userModel, value);
		}

		public void ShowMessage(string content,MessageBoxButton button = MessageBoxButton.OK)
		{
			//解决线程操作UI问题
			App.Current.Dispatcher.Invoke(() =>
			{
				DialogHost.Show(new DialogControl(content, button), "ShellDialog");
			});
		}
	}
}
